Established technology exists for performing predetermined processing to specify an area in a photographed image (frame image) taken at predetermined intervals (e.g. every 33 ms) by digital cameras or the like, the area including a specified image (e.g. a facial image) smaller than the size of the photographed image, and to display a frame on the specified area, to focus on the specified area, etc.
One method for specifying an area including a specified image is to detect the specified image by comparing a template image (an image of a predetermined size, smaller than the photographed image) for detecting the specified image with a plurality of reduced images based on the photographed image, which are generated by changing the reduction ratio incrementally. In other words, a specified image is detected by performing comparative processing for each reduced image while shifting the template image from the upper left pixel of the rectangular reduced image to the lower right pixel. Based on the results of this processing, the area containing the specified image is identified.
The reduction ratios are preset so as to make it possible to detect specified images of varying sizes included in a photographed image by comparing the generated plurality of reduced images with the template image.
Such processing to generate reduced images, however, generally requires a relatively long period of time, and as the number of reduced images generated from one photographed image grows larger, it may become impossible to detect a specified image within the time interval between photographs (in this example, 33 ms).
In particular, when a moving subject is being photographed, and for example photographs are displayed at the same rate as the photography frame rate, then if for a certain photographed image, a specified image is detected after the time interval between photographs has elapsed, the specified image area and the actual area in the subject may become out of alignment to a relatively large degree. For example, if predetermined processing is performed to display a frame around the specified image area, the location of the frame may end up differing from the location in the actual subject.
To solve this problem, there is a known method of improving the probability of detecting a specified image within the time interval between photographs by changing the order in which reduced images are generated in accordance with the photography mode of the digital camera (for example, Patent Document 1).
In the imaging apparatus in Patent Document 1, it is possible to generate reduced images G1-G7 that are incrementally reduced from the original image G0 (in this example, the size decreases sequentially from G1 to G7). On the other hand, if the camera is in a mode for photographing people or other such mode in which close-range photography of a small number of people can be expected, then since the size of the facial images in the photographed image tends to be larger in these modes, the reduced images can be generated in the order from G7 to G0 and compared with the template image. Furthermore, if the camera is in a mode for photographing scenery or other such mode in which long-range photography can be expected, then since the size of the facial images in the photographed image tends to be smaller in these modes, the reduced images can be generated in the order from G0 to G7 and compared with the template image.
As a result, even if comparison of all of the reduced images with the template is not complete within the time interval between photographs and processing must proceed to the next photographed image, it is possible to improve the probability of detecting a specified image within the time interval between photographs.